home *** CD-ROM | disk | FTP | other *** search
/ Turnbull China Bikeride / Turnbull China Bikeride - Disc 1.iso / ARGONET / PD / PROGRAMMING / DESKLIBC / SOURCES.ZIP / DeskLib / !DLSources / Libraries / Pane2 / c / CAddMain < prev    next >
Text File  |  1995-08-23  |  2KB  |  53 lines

  1. /*
  2.     ####             #    #     # #
  3.     #   #            #    #       #          The FreeWare C library for 
  4.     #   #  ##   ###  #  # #     # ###             RISC OS machines
  5.     #   # #  # #     # #  #     # #  #   ___________________________________
  6.     #   # ####  ###  ##   #     # #  #                                      
  7.     #   # #        # # #  #     # #  #    Please refer to the accompanying
  8.     ####   ### ####  #  # ##### # ###    documentation for conditions of use
  9.     ________________________________________________________________________
  10.  
  11.     File:    Pane2.CAddMain.c
  12.     Author:  Copyright © 1995 Andrew Sellors.
  13.     Version: 1.04 (4th August 1995)
  14.     Purpose: Handles windows with panes.
  15. */
  16.  
  17. #include "DeskLib:Pane2.h"
  18. #include "Pane2Defs.h"
  19. #include "Desklib:Event.h"
  20. #include "DeskLib:Template.h"
  21. #include "Desklib:EventMsg.h"
  22. #include "Desklib:Error.h"
  23.  
  24. #include <stdlib.h>
  25.  
  26.  
  27. /******************************************************************************/
  28.  
  29. extern window_handle Pane2_CreateAndAddMain(char *windowname, int maxtitlesize)
  30. {
  31.  /*
  32.   * Creates window as Window_Create and initialises it with the library as a
  33.   * main window that can have panes attached to it.
  34.   * The window handle is returned or 0 if window cannot be created.
  35.   */
  36.   window_handle mainwindow;
  37.  
  38.   mainwindow = Window_Create(windowname, maxtitlesize);
  39.  
  40.   if(mainwindow != 0){
  41.  
  42.      if(!Pane2_AddMain(mainwindow)){
  43.  
  44.         Window_Delete(mainwindow); /* delete mainwindow if could not be added */
  45.         mainwindow = 0;
  46.  
  47.      }
  48.  
  49.   }
  50.  
  51.   return(mainwindow);
  52. }
  53.